#include<stdlib.h>
#ifndef OPANDTYPES_INCLUDED
    #define OPANDTYPES_INCLUDED

    enum OPERATORTYPE{
    OPERATOR = -100,
    PLUS = -99,
    MUL = -98,
    SUB = -97,
    DIV = -96,
    NUMBER = -95, VARIABLE = -94, FUNCTION = -93,
    MOV = -92,
    DEGREE = 10,
    LOG    = 11,
    EXP    = 12,
    SIN    = 13,
    COS    = 14
    };

#endif // OPANDTYPES_INCLUDED

#include<malloc.h>
#include<stdio.h>
#include<assert.h>
//nType describes node type: NUMBER, OPERATOR...
//opType only for OPERATOR: MUL, PLUS...
    struct node_t
{
    double value;
    int nType;
    char name[20];
    node_t* l;
    node_t* r;
};

struct variable
{
    char name[20];
};


node_t* nodeNew(double value, node_t* left, node_t* right);
node_t* nodeNew(int typeN, int opType, node_t* left, node_t* right);

int printTree(const node_t* root, FILE* f);
int printTreeP(const node_t* root, FILE* f);
int tree_dtor(node_t* root);

